package com.lmx.repoDomain.tmodel;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import com.lmx.repoDomain.tmodel.business.User;

import io.katharsis.resource.annotations.JsonApiIncludeByDefault;
import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

/**
 * 活动计划表（临时）
 */
@JsonApiResource(type = "customeractivityplanserviceitemdetail")
@Table(name = "tnb_activityplan_detail")
@Entity
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class CustomerActivityPlanServiceItemDetail extends BaseEntity {

	private User lastUpdateUser;// 更新操作者userid

	private Integer createDateTime;// 创建时间

	private User createUser;

	private Integer lastUpdateDateTime;// 更新时间

	private String remark;// 备注

	private Integer yearTab;// 年

	private Integer weekIndex;// 周序号

	private Integer weekTab;// 星期几
	
	private Integer monthIndex;// 几月

	private Integer monthTab;// 几号

	private String startTimeTab;// 小时标记

	private Customer customer;

	private CustomerActivityProjectItem item;  // 老人活动方案项目表ID

	private CustomerNursingPlan plan;

	private Integer monthPlanNum;// 月计划 当天次数
	
	private Integer weekPlanNum;// 周计划 当天次数

	private Integer dayPlanNum;// 日计划当天次数

	private Integer weekCounts;// 周计划当周次数

	@Transient
	public Integer getWeekCounts() {
		return weekCounts;
	}

	public void setWeekCounts(Integer weekCounts) {
		this.weekCounts = weekCounts;
	}

	@Transient
	public Integer getWeekPlanNum() {
		return weekPlanNum;
	}

	public void setWeekPlanNum(Integer weekPlanNum) {
		this.weekPlanNum = weekPlanNum;
	}

	@Transient
	public Integer getDayPlanNum() {
		return dayPlanNum;
	}

	public void setDayPlanNum(Integer dayPlanNum) {
		this.dayPlanNum = dayPlanNum;
	}

	@Transient
	@JsonApiToOne
	public CustomerNursingPlan getPlan() {
		return plan;
	}

	public void setPlan(CustomerNursingPlan plan) {
		this.plan = plan;
	}

	@Column(name = "year_tab")
	public Integer getYearTab() {
		return yearTab;
	}

	public void setYearTab(Integer yearTab) {
		this.yearTab = yearTab;
	}

	@Column(name = "week_tab")
	public Integer getWeekTab() {
		return weekTab;
	}

	public void setWeekTab(Integer weekTab) {
		this.weekTab = weekTab;
	}

	@Column(name = "week_index")
	public Integer getWeekIndex() {
		return weekIndex;
	}

	public void setWeekIndex(Integer weekIndex) {
		this.weekIndex = weekIndex;
	}

	@Column(name = "starttime_tab")
	public String getStartTimeTab() {
		return startTimeTab;
	}

	public void setStartTimeTab(String startTimeTab) {
		this.startTimeTab = startTimeTab;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@Fetch(FetchMode.JOIN)
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "packageitemID", foreignKey = @ForeignKey(name = "null"))
	public CustomerActivityProjectItem getItem() {
		return item;
	}

	public void setItem(CustomerActivityProjectItem item) {
		this.item = item;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@Fetch(FetchMode.JOIN)
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "customer_id", foreignKey = @ForeignKey(name = "null"))
	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@Column(name = "createDateTime")
	public Integer getCreateDateTime() {
		return createDateTime;
	}

	public void setCreateDateTime(Integer createDateTime) {
		this.createDateTime = createDateTime;
	}

	@Column(name = "lastUpdateDateTime")
	public Integer getLastUpdateDateTime() {
		return lastUpdateDateTime;
	}

	public void setLastUpdateDateTime(Integer lastUpdateDateTime) {
		this.lastUpdateDateTime = lastUpdateDateTime;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "createuser_id", foreignKey = @ForeignKey(name = "null"))
	public User getCreateUser() {
		return createUser;
	}

	public void setCreateUser(User createUser) {
		this.createUser = createUser;
	}

	@JsonApiToOne
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@JoinColumn(name = "lastupdateuser_id", foreignKey = @ForeignKey(name = "null"))
	public User getLastUpdateUser() {
		return lastUpdateUser;
	}

	public void setLastUpdateUser(User lastUpdateUser) {
		this.lastUpdateUser = lastUpdateUser;
	}

	public CustomerActivityPlanServiceItemDetail() {
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "month_index")
	public Integer getMonthIndex() {
		return monthIndex;
	}

	public void setMonthIndex(Integer monthIndex) {
		this.monthIndex = monthIndex;
	}

	@Column(name = "month_tab")
	public Integer getMonthTab() {
		return monthTab;
	}

	public void setMonthTab(Integer monthTab) {
		this.monthTab = monthTab;
	}

	@Transient
	public Integer getMonthPlanNum() {
		return monthPlanNum;
	}

	public void setMonthPlanNum(Integer monthPlanNum) {
		this.monthPlanNum = monthPlanNum;
	}

}
